function responsSuccess(response,data,msg="ok"){
  response.json({
    code:0,
    msg,
    data
  })
}

function responsError(response,error,msg=""){
  response.json({
    code:error.errorCode,
    msg:msg===""?error.message:msg,
    data:null
  })
}

module.exports={
  responsSuccess,
  responsError
}
